<html>
<head><meta charset="utf-8"><title>Specialization causes mis-optimizations · t-compiler/wg-mir-opt · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/index.html">t-compiler/wg-mir-opt</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Specialization.20causes.20mis-optimizations.html">Specialization causes mis-optimizations</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="184119755"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Specialization%20causes%20mis-optimizations/near/184119755" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Specialization.20causes.20mis-optimizations.html#184119755">(Dec 23 2019 at 17:33)</a>:</h4>
<p>So it looks like <span class="user-mention" data-user-id="119009">@eddyb</span> was absolutely correct <a href="https://github.com/rust-lang/rust/issues/66901#issuecomment-559967497" target="_blank" title="https://github.com/rust-lang/rust/issues/66901#issuecomment-559967497">here</a> when they suggested that <code>Instance::resolve()</code> is not correctly handling <code>default</code> trait items. I took their suggestion and added the logic to <code>Instance::resolve()</code> in <a href="https://github.com/rust-lang/rust/compare/master...wesleywiser:optimizations_handle_specialization" target="_blank" title="https://github.com/rust-lang/rust/compare/master...wesleywiser:optimizations_handle_specialization">this branch</a>. That fixes the bad optimizations (issues in <code>Inline</code>, <code>ConstProp</code>, and also <code>SimplifyBranches</code>) but it breaks a few UI tests and I'm not exactly sure why. </p>
<div class="codehilite"><pre><span></span>failures:
    [ui] ui/associated-consts/associated-const-cross-crate-defaults.rs
    [ui] ui/associated-consts/associated-const-use-default.rs
    [ui] ui/consts/miri_unleashed/assoc_const.rs
    [ui] ui/consts/miri_unleashed/assoc_const_2.rs
    [ui] ui/consts/trait_specialization.rs
    [ui] ui/custom_test_frameworks/dynamic.rs
    [ui] ui/issues/issue-11205.rs
    [ui] ui/rfcs/rfc-2005-default-binding-mode/constref.rs
    [ui] ui/ufcs-polymorphic-paths.rs
</pre></div>


<p>The most common failure is <a href="https://github.com/rust-lang/rust/blob/a916ac22b9f7f1f0f7aba0a41a789b3ecd765018/src/librustc_mir/const_eval.rs#L668" target="_blank" title="https://github.com/rust-lang/rust/blob/a916ac22b9f7f1f0f7aba0a41a789b3ecd765018/src/librustc_mir/const_eval.rs#L668">this assertion</a> failing. cc <span class="user-mention" data-user-id="124288">@oli</span> I think you authored this. </p>
<p>I believe the issue is that with my patch <code>Reveal::UserFacing</code> can cause <code>Instance::resolve()</code> to return <code>None</code> where with <code>Reveal::All</code> it would return a default impl.</p>



<a name="184119778"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Specialization%20causes%20mis-optimizations/near/184119778" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Specialization.20causes.20mis-optimizations.html#184119778">(Dec 23 2019 at 17:33)</a>:</h4>
<p>I guess my question is: why does the calling code use <code>Reveal::All</code> but here we change it to use <code>Reveal::UserFacing</code>?</p>



<a name="184119956"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Specialization%20causes%20mis-optimizations/near/184119956" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Specialization.20causes.20mis-optimizations.html#184119956">(Dec 23 2019 at 17:36)</a>:</h4>
<p>Oh wait, the comment in <code>const_eval_raw_provider()</code> does explain this...</p>



<a name="184119995"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Specialization%20causes%20mis-optimizations/near/184119995" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Specialization.20causes.20mis-optimizations.html#184119995">(Dec 23 2019 at 17:37)</a>:</h4>
<p>I guess this code needs to be updated to handle <code>TooGeneric</code> differently because <code>TooGeneric</code> when <code>Reveal::UserFacing</code> does not necessarily mean it will fail when <code>Reveal::All</code> is used.</p>



<a name="184120119"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Specialization%20causes%20mis-optimizations/near/184120119" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Specialization.20causes.20mis-optimizations.html#184120119">(Dec 23 2019 at 17:39)</a>:</h4>
<p>oh, yea that assert makes no sense this way</p>



<a name="184120168"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Specialization%20causes%20mis-optimizations/near/184120168" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Specialization.20causes.20mis-optimizations.html#184120168">(Dec 23 2019 at 17:40)</a>:</h4>
<p>feel free to remove it without a replacement</p>



<a name="184120187"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Specialization%20causes%20mis-optimizations/near/184120187" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Specialization.20causes.20mis-optimizations.html#184120187">(Dec 23 2019 at 17:40)</a>:</h4>
<p>Won't that re-introduce <a href="https://github.com/rust-lang/rust/issues/55454" target="_blank" title="https://github.com/rust-lang/rust/issues/55454">#55454</a>?</p>



<a name="184120237"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Specialization%20causes%20mis-optimizations/near/184120237" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Specialization.20causes.20mis-optimizations.html#184120237">(Dec 23 2019 at 17:41)</a>:</h4>
<p>No, this assert is not load bearing. It's just something I assumed to never happen</p>



<a name="184120303"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Specialization%20causes%20mis-optimizations/near/184120303" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Specialization.20causes.20mis-optimizations.html#184120303">(Dec 23 2019 at 17:42)</a>:</h4>
<p>Ok, gotcha. Looks like there's a covering test so I can remove and make sure those tests still pass to verify nothing else breaks.</p>



<a name="184120334"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Specialization%20causes%20mis-optimizations/near/184120334" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Specialization.20causes.20mis-optimizations.html#184120334">(Dec 23 2019 at 17:44)</a>:</h4>
<p>well, the test isn't ICEing, so the assert can't have an effect on it</p>



<a name="184120377"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Specialization%20causes%20mis-optimizations/near/184120377" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Specialization.20causes.20mis-optimizations.html#184120377">(Dec 23 2019 at 17:44)</a>:</h4>
<p>Ah right</p>



<a name="184120413"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Specialization%20causes%20mis-optimizations/near/184120413" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Specialization.20causes.20mis-optimizations.html#184120413">(Dec 23 2019 at 17:45)</a>:</h4>
<p>but if you want to keep the assert, you can put it in <a href="https://github.com/rust-lang/rust/blob/a916ac22b9f7f1f0f7aba0a41a789b3ecd765018/src/librustc_mir/const_eval.rs#L784" target="_blank" title="https://github.com/rust-lang/rust/blob/a916ac22b9f7f1f0f7aba0a41a789b3ecd765018/src/librustc_mir/const_eval.rs#L784">https://github.com/rust-lang/rust/blob/a916ac22b9f7f1f0f7aba0a41a789b3ecd765018/src/librustc_mir/const_eval.rs#L784</a> (assert that <code>key.param_env.reveal != Reveal::All || err_inval!(TooGeneric) != err.error</code>)</p>



<a name="184120538"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Specialization%20causes%20mis-optimizations/near/184120538" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Specialization.20causes.20mis-optimizations.html#184120538">(Dec 23 2019 at 17:47)</a>:</h4>
<p>9 test failures -&gt; 5</p>



<a name="184120619"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Specialization%20causes%20mis-optimizations/near/184120619" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Specialization.20causes.20mis-optimizations.html#184120619">(Dec 23 2019 at 17:48)</a>:</h4>
<p>There's an LLVM failure I have no idea how to debug so I'm going to leave that for last and hope it get's fixed along the way :)</p>



<a name="184120835"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Specialization%20causes%20mis-optimizations/near/184120835" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Specialization.20causes.20mis-optimizations.html#184120835">(Dec 23 2019 at 17:52)</a>:</h4>
<p>Not sure what ui test failures you're getting, but maybe some are legit fixes?</p>



<a name="184120964"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Specialization%20causes%20mis-optimizations/near/184120964" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Specialization.20causes.20mis-optimizations.html#184120964">(Dec 23 2019 at 17:55)</a>:</h4>
<p>Down to 2, I'll post the details when this build finishes</p>



<a name="184121234"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Specialization%20causes%20mis-optimizations/near/184121234" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Specialization.20causes.20mis-optimizations.html#184121234">(Dec 23 2019 at 17:59)</a>:</h4>
<div class="codehilite"><pre><span></span>failures:

---- [ui] ui/rfcs/rfc-2005-default-binding-mode/constref.rs stdout ----

error: test compilation failed although it shouldn&#39;t!
status: exit code: 1
command: &quot;/home/wesley/code/rust/rust/build/x86_64-unknown-linux-gnu/stage1/bin/rustc&quot; &quot;/home/wesley/code/rust/rust/build/x86_64-unknown-linux-gnu/stage1/bin/rustc&quot; &quot;/home/wesley/code/rust/rust/src/test/ui/rfcs/rfc-2005-default-binding-mode/constref.rs&quot; &quot;-Zthreads=1&quot; &quot;--target=x86_64-unknown-linux-gnu&quot; &quot;--error-format&quot; &quot;json&quot; &quot;-Zui-testing&quot; &quot;-C&quot; &quot;prefer-dynamic&quot; &quot;-o&quot; &quot;/home/wesley/code/rust/rust/build/x86_64-unknown-linux-gnu/test/ui/rfcs/rfc-2005-default-binding-mode/constref/a&quot; &quot;-Crpath&quot; &quot;-Cdebuginfo=0&quot; &quot;-Zunstable-options&quot; &quot;-Lnative=/home/wesley/code/rust/rust/build/x86_64-unknown-linux-gnu/native/rust-test-helpers&quot; &quot;-L&quot; &quot;/home/wesley/code/rust/rust/build/x86_64-unknown-linux-gnu/test/ui/rfcs/rfc-2005-default-binding-mode/constref/auxiliary&quot;
stdout:
------------------------------------------

------------------------------------------
stderr:
------------------------------------------
error[E0158]: associated consts cannot be referenced in patterns
  --&gt; /home/wesley/code/rust/rust/src/test/ui/rfcs/rfc-2005-default-binding-mode/constref.rs:32:10
   |
LL |         (i32::CONST_REF_DEFAULT, i32::CONST_REF, i64::CONST_REF_DEFAULT, i64::CONST_REF) =&gt; true,
   |          ^^^^^^^^^^^^^^^^^^^^^^

error: aborting due to previous error

For more information about this error, try `rustc --explain E0158`.

------------------------------------------


---- [ui] ui/ufcs-polymorphic-paths.rs stdout ----

error: test compilation failed although it shouldn&#39;t!
status: exit code: 101
command: &quot;/home/wesley/code/rust/rust/build/x86_64-unknown-linux-gnu/stage1/bin/rustc&quot; &quot;/home/wesley/code/rust/rust/build/x86_64-unknown-linux-gnu/stage1/bin/rustc&quot; &quot;/home/wesley/code/rust/rust/src/test/ui/ufcs-polymorphic-paths.rs&quot; &quot;-Zthreads=1&quot; &quot;--target=x86_64-unknown-linux-gnu&quot; &quot;--error-format&quot; &quot;json&quot; &quot;-Zui-testing&quot; &quot;-C&quot; &quot;prefer-dynamic&quot; &quot;-o&quot; &quot;/home/wesley/code/rust/rust/build/x86_64-unknown-linux-gnu/test/ui/ufcs-polymorphic-paths/a&quot; &quot;-Crpath&quot; &quot;-Cdebuginfo=0&quot; &quot;-Zunstable-options&quot; &quot;-Lnative=/home/wesley/code/rust/rust/build/x86_64-unknown-linux-gnu/native/rust-test-helpers&quot; &quot;-L&quot; &quot;/home/wesley/code/rust/rust/build/x86_64-unknown-linux-gnu/test/ui/ufcs-polymorphic-paths/auxiliary&quot;
stdout:
------------------------------------------

------------------------------------------
stderr:
------------------------------------------
Global is external, but doesn&#39;t have external or weak linkage!
i64 ()** @_ZN22ufcs_polymorphic_paths4main1S17h617838d98e0a145aE
Global is external, but doesn&#39;t have external or weak linkage!
i64 ()** @_ZN22ufcs_polymorphic_paths4main1S17h6d6a871d84675c61E
Global is external, but doesn&#39;t have external or weak linkage!
i64 ()** @_ZN22ufcs_polymorphic_paths4main1S17h08975e9ef2b0831eE
Global is external, but doesn&#39;t have external or weak linkage!
i32 (%XorShiftRng*)** @_ZN22ufcs_polymorphic_paths4main1S17h348875713cbbb989E
Global is external, but doesn&#39;t have external or weak linkage!
i32 (%XorShiftRng*)** @_ZN22ufcs_polymorphic_paths4main1S17h4e60c7352cd11b4aE
Global is external, but doesn&#39;t have external or weak linkage!
i32 (%XorShiftRng*)** @_ZN22ufcs_polymorphic_paths4main1S17h5ff48db54f3efa7aE
Global is external, but doesn&#39;t have external or weak linkage!
i32 (%XorShiftRng*)** @_ZN22ufcs_polymorphic_paths4main1S17hf6a8ed03bf7edb7eE
Global is external, but doesn&#39;t have external or weak linkage!
i32 (%XorShiftRng*)** @_ZN22ufcs_polymorphic_paths4main1S17hdf6a847ad5e63ca9E
Global is external, but doesn&#39;t have external or weak linkage!
i32 (%XorShiftRng*)** @_ZN22ufcs_polymorphic_paths4main1S17h93c1cfcdf807a32bE
Global is external, but doesn&#39;t have external or weak linkage!
i32 (%XorShiftRng*)** @_ZN22ufcs_polymorphic_paths4main1S17h49ed8eee2ac98a8fE
Global is external, but doesn&#39;t have external or weak linkage!
i32 (%XorShiftRng*)** @_ZN22ufcs_polymorphic_paths4main1S17h000c406925f8c1b6E
LLVM ERROR: Broken module found, compilation aborted!

------------------------------------------



failures:
    [ui] ui/rfcs/rfc-2005-default-binding-mode/constref.rs
    [ui] ui/ufcs-polymorphic-paths.rs

test result: FAILED. 9381 passed; 2 failed; 45 ignored; 0 measured; 0 filtered out
</pre></div>



<a name="184128229"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Specialization%20causes%20mis-optimizations/near/184128229" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Specialization.20causes.20mis-optimizations.html#184128229">(Dec 23 2019 at 19:53)</a>:</h4>
<p>I think I resolved the <code>constref.rs</code> test but I'm not 100% sure about the changes. The <code>ufcs-polymorphic-paths</code> test continues to elude me...</p>



<a name="184170573"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Specialization%20causes%20mis-optimizations/near/184170573" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Specialization.20causes.20mis-optimizations.html#184170573">(Dec 24 2019 at 13:53)</a>:</h4>
<p>I'm starting to wonder if there's something wrong with my llvm build:</p>
<div class="codehilite"><pre><span></span>wesley@endurance:~/code/rust/rust&gt; rustc +stage1 src/test/ui/ufcs-polymorphic-paths.rs
Global is external, but doesn&#39;t have external or weak linkage!
i64 ()** @_ZN22ufcs_polymorphic_paths4main1S17h0036ecaaa6b24075E
LLVM ERROR: Broken module found, compilation aborted!
LLVM ERROR: &quot; Ȇ�DVnspecified&quot; pass is not registered.
</pre></div>



<a name="184176107"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Specialization%20causes%20mis-optimizations/near/184176107" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Specialization.20causes.20mis-optimizations.html#184176107">(Dec 24 2019 at 15:50)</a>:</h4>
<p>maybe we're missing a few things because we don't collect them correctly now?</p>



<a name="184176167"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Specialization%20causes%20mis-optimizations/near/184176167" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Specialization.20causes.20mis-optimizations.html#184176167">(Dec 24 2019 at 15:50)</a>:</h4>
<p>like if we forget to adjust substs correctly I'd imagine the collector to miss some items, but they'll still be referred to</p>



<a name="184176181"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Specialization%20causes%20mis-optimizations/near/184176181" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Specialization.20causes.20mis-optimizations.html#184176181">(Dec 24 2019 at 15:51)</a>:</h4>
<p>we've had problems like this with exposed bodies before</p>



<a name="184176412"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Specialization%20causes%20mis-optimizations/near/184176412" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Specialization.20causes.20mis-optimizations.html#184176412">(Dec 24 2019 at 15:55)</a>:</h4>
<p>Maybe?</p>



<a name="184176754"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Specialization%20causes%20mis-optimizations/near/184176754" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Specialization.20causes.20mis-optimizations.html#184176754">(Dec 24 2019 at 16:03)</a>:</h4>
<p>I dumped the LLVM IR and here's the diff (minus unimportant stuff like hash changes):</p>
<p>Before:</p>
<div class="codehilite"><pre><span></span><span class="vg">@_ZN22ufcs_polymorphic_paths4main1S17h0036ecaaa6b24075E</span> <span class="p">=</span> <span class="k">internal</span> <span class="k">constant</span> <span class="p">&lt;{</span> <span class="k">i8</span><span class="p">*,</span> <span class="p">[</span><span class="m">0</span> <span class="k">x</span> <span class="k">i8</span><span class="p">]</span> <span class="p">}&gt;</span> <span class="p">&lt;{</span> <span class="k">i8</span><span class="p">*</span> <span class="k">bitcast</span> <span class="p">(</span><span class="k">i64</span> <span class="p">()*</span> <span class="vg">@_ZN22ufcs_polymorphic_paths4Size4size17hb2d75803bb586561E</span> <span class="k">to</span> <span class="k">i8</span><span class="p">*),</span> <span class="p">[</span><span class="m">0</span> <span class="k">x</span> <span class="k">i8</span><span class="p">]</span> <span class="k">zeroinitializer</span> <span class="p">}&gt;,</span> <span class="k">align</span> <span class="m">8</span>

<span class="c">; ufcs_polymorphic_paths::Size::size</span>
<span class="c">; Function Attrs: nonlazybind uwtable</span>
<span class="k">define</span> <span class="k">internal</span> <span class="k">i64</span> <span class="vg">@_ZN22ufcs_polymorphic_paths4Size4size17hb2d75803bb586561E</span><span class="p">()</span> <span class="k">unnamed_addr</span> <span class="vg">#0</span> <span class="p">{</span>
<span class="nl">start:</span>
  <span class="nv nv-Anonymous">%0</span> <span class="p">=</span> <span class="k">alloca</span> <span class="k">i64</span><span class="p">,</span> <span class="k">align</span> <span class="m">8</span>
  <span class="k">store</span> <span class="k">i64</span> <span class="m">1</span><span class="p">,</span> <span class="k">i64</span><span class="p">*</span> <span class="nv nv-Anonymous">%0</span><span class="p">,</span> <span class="k">align</span> <span class="m">8</span>
  <span class="nv nv-Anonymous">%1</span> <span class="p">=</span> <span class="k">load</span> <span class="k">i64</span><span class="p">,</span> <span class="k">i64</span><span class="p">*</span> <span class="nv nv-Anonymous">%0</span><span class="p">,</span> <span class="k">align</span> <span class="m">8</span>
  <span class="k">br</span> <span class="k">label</span> <span class="nv">%bb1</span>

<span class="nl">bb1:</span>                                              <span class="c">; preds = %start</span>
  <span class="k">ret</span> <span class="k">i64</span> <span class="nv nv-Anonymous">%1</span>
<span class="p">}</span>
</pre></div>


<p>After:</p>
<div class="codehilite"><pre><span></span><span class="vg">@_ZN22ufcs_polymorphic_paths4main1S17h0036ecaaa6b24075E</span> <span class="p">=</span> <span class="k">internal</span> <span class="k">global</span> <span class="k">i64</span> <span class="p">()*</span>
</pre></div>



<a name="184176764"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Specialization%20causes%20mis-optimizations/near/184176764" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Specialization.20causes.20mis-optimizations.html#184176764">(Dec 24 2019 at 16:03)</a>:</h4>
<p>So that seems like a strong possibility</p>



<a name="184240221"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Specialization%20causes%20mis-optimizations/near/184240221" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Specialization.20causes.20mis-optimizations.html#184240221">(Dec 26 2019 at 02:38)</a>:</h4>
<p>I tried to look into this by deduplicating the bail out logic in <a href="https://github.com/oli-obk/rust/pull/new/instance_resolve_specialization" target="_blank" title="https://github.com/oli-obk/rust/pull/new/instance_resolve_specialization">https://github.com/oli-obk/rust/pull/new/instance_resolve_specialization</a> to see if there are any differences between <code>assemble_candidates_from_impls</code> and <code>resolve</code></p>



<a name="184240225"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Specialization%20causes%20mis-optimizations/near/184240225" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Specialization.20causes.20mis-optimizations.html#184240225">(Dec 26 2019 at 02:38)</a>:</h4>
<p>But it seems like my scheme won't work</p>



<a name="184240231"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Specialization%20causes%20mis-optimizations/near/184240231" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Specialization.20causes.20mis-optimizations.html#184240231">(Dec 26 2019 at 02:39)</a>:</h4>
<p>but I noticed two things: the changes to ui on the "erroneous constant" tests are odd</p>



<a name="184240235"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Specialization%20causes%20mis-optimizations/near/184240235" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Specialization.20causes.20mis-optimizations.html#184240235">(Dec 26 2019 at 02:39)</a>:</h4>
<p>they used to get reported in const prop</p>



<a name="184240239"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Specialization%20causes%20mis-optimizations/near/184240239" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Specialization.20causes.20mis-optimizations.html#184240239">(Dec 26 2019 at 02:39)</a>:</h4>
<p>now they get reported at monomorphization time in codegen</p>



<a name="184240240"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Specialization%20causes%20mis-optimizations/near/184240240" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Specialization.20causes.20mis-optimizations.html#184240240">(Dec 26 2019 at 02:39)</a>:</h4>
<p>but the function was already monomorphic</p>



<a name="184240243"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Specialization%20causes%20mis-optimizations/near/184240243" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Specialization.20causes.20mis-optimizations.html#184240243">(Dec 26 2019 at 02:39)</a>:</h4>
<p>so shouldn't it keep getting reported from const prop?</p>



<a name="184240337"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Specialization%20causes%20mis-optimizations/near/184240337" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Specialization.20causes.20mis-optimizations.html#184240337">(Dec 26 2019 at 02:42)</a>:</h4>
<p>Hmm</p>



<a name="184240341"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Specialization%20causes%20mis-optimizations/near/184240341" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Specialization.20causes.20mis-optimizations.html#184240341">(Dec 26 2019 at 02:42)</a>:</h4>
<p>the other thing I noticed: I can cause metadata loading to ICE if I make <code>confirm_impl_candidate</code> also succeed with the same strategy used in <code>assemble_candidates_from_impls</code></p>



<a name="184240482"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Specialization%20causes%20mis-optimizations/near/184240482" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Specialization.20causes.20mis-optimizations.html#184240482">(Dec 26 2019 at 02:48)</a>:</h4>
<blockquote>
<p>ut I noticed two things: the changes to ui on the "erroneous constant" tests are odd</p>
</blockquote>
<p>Something interesting I'm looking into with the ufcs test is that it appears to be related to a constant being missed during codegen</p>



<a name="184261471"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Specialization%20causes%20mis-optimizations/near/184261471" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> anp <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Specialization.20causes.20mis-optimizations.html#184261471">(Dec 26 2019 at 13:23)</a>:</h4>
<p><span aria-label="eyes" class="emoji emoji-1f440" role="img" title="eyes">:eyes:</span> since i think i'm blocked on <a href="https://github.com/rust-lang/rust/pull/67137#issuecomment-568655485" target="_blank" title="https://github.com/rust-lang/rust/pull/67137#issuecomment-568655485">https://github.com/rust-lang/rust/pull/67137#issuecomment-568655485</a> bc of this</p>



<a name="184261719"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Specialization%20causes%20mis-optimizations/near/184261719" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Specialization.20causes.20mis-optimizations.html#184261719">(Dec 26 2019 at 13:28)</a>:</h4>
<p><span class="user-mention" data-user-id="130111">@anp</span> I found something: I think in your situation the bug is actually that <a href="https://github.com/rust-lang/rust/blob/acb6690e1d58fc5f262ada5b5030fe73e601f1e8/src/librustc_mir/transform/const_prop.rs#L414" target="_blank" title="https://github.com/rust-lang/rust/blob/acb6690e1d58fc5f262ada5b5030fe73e601f1e8/src/librustc_mir/transform/const_prop.rs#L414">https://github.com/rust-lang/rust/blob/acb6690e1d58fc5f262ada5b5030fe73e601f1e8/src/librustc_mir/transform/const_prop.rs#L414</a> ignores <a href="https://github.com/rust-lang/rust/blob/a916ac22b9f7f1f0f7aba0a41a789b3ecd765018/src/librustc_mir/interpret/operand.rs#L565-L566" target="_blank" title="https://github.com/rust-lang/rust/blob/a916ac22b9f7f1f0f7aba0a41a789b3ecd765018/src/librustc_mir/interpret/operand.rs#L565-L566">https://github.com/rust-lang/rust/blob/a916ac22b9f7f1f0f7aba0a41a789b3ecd765018/src/librustc_mir/interpret/operand.rs#L565-L566</a></p>



<a name="184261725"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Specialization%20causes%20mis-optimizations/near/184261725" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Specialization.20causes.20mis-optimizations.html#184261725">(Dec 26 2019 at 13:28)</a>:</h4>
<p>The constant has not yet been monomorphized</p>



<a name="184261730"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Specialization%20causes%20mis-optimizations/near/184261730" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> anp <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Specialization.20causes.20mis-optimizations.html#184261730">(Dec 26 2019 at 13:28)</a>:</h4>
<p>interesting</p>



<a name="184261731"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Specialization%20causes%20mis-optimizations/near/184261731" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Specialization.20causes.20mis-optimizations.html#184261731">(Dec 26 2019 at 13:29)</a>:</h4>
<p><span class="user-mention" data-user-id="125250">@Wesley Wiser</span> this may in fact be what is causing the "erroneous constant" tests to change</p>



<a name="184261748"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Specialization%20causes%20mis-optimizations/near/184261748" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Specialization.20causes.20mis-optimizations.html#184261748">(Dec 26 2019 at 13:29)</a>:</h4>
<p>@anp I'll open a rustc PR, then you can rebase over it</p>



<a name="184261824"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Specialization%20causes%20mis-optimizations/near/184261824" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> anp <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Specialization.20causes.20mis-optimizations.html#184261824">(Dec 26 2019 at 13:31)</a>:</h4>
<p><span aria-label="heart" class="emoji emoji-2764" role="img" title="heart">:heart:</span></p>



<a name="184263898"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Specialization%20causes%20mis-optimizations/near/184263898" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Specialization.20causes.20mis-optimizations.html#184263898">(Dec 26 2019 at 14:15)</a>:</h4>
<p>ok, <a href="https://github.com/rust-lang/rust/pull/67631" target="_blank" title="https://github.com/rust-lang/rust/pull/67631">that</a> should do it. lemme know if these tests still give you trouble</p>



<a name="184264658"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Specialization%20causes%20mis-optimizations/near/184264658" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> anp <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Specialization.20causes.20mis-optimizations.html#184264658">(Dec 26 2019 at 14:29)</a>:</h4>
<p>no dice <span aria-label="frown" class="emoji emoji-1f641" role="img" title="frown">:frown:</span></p>



<a name="184264726"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Specialization%20causes%20mis-optimizations/near/184264726" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> anp <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Specialization.20causes.20mis-optimizations.html#184264726">(Dec 26 2019 at 14:30)</a>:</h4>
<p>anything you want me to try?</p>



<a name="184268201"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Specialization%20causes%20mis-optimizations/near/184268201" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Specialization.20causes.20mis-optimizations.html#184268201">(Dec 26 2019 at 15:52)</a>:</h4>
<p>hmm... can you try dumping the MIR at <code>ConstProp.before</code> for the test?</p>



<a name="184268358"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Specialization%20causes%20mis-optimizations/near/184268358" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Specialization.20causes.20mis-optimizations.html#184268358">(Dec 26 2019 at 15:56)</a>:</h4>
<p>also a backtrace by compiling the test with <code>-Ztreat-err-as-bug</code> could help pinpoint the source</p>



<a name="184268445"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Specialization%20causes%20mis-optimizations/near/184268445" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Specialization.20causes.20mis-optimizations.html#184268445">(Dec 26 2019 at 15:58)</a>:</h4>
<p><span class="user-mention" data-user-id="130111">@anp</span> actually, I may have done a stupid and not actually affected the code that evaluates the constant in your case. Try adding the same bailout check before <a href="https://github.com/rust-lang/rust/blob/acb6690e1d58fc5f262ada5b5030fe73e601f1e8/src/librustc_mir/transform/const_prop.rs#L561" target="_blank" title="https://github.com/rust-lang/rust/blob/acb6690e1d58fc5f262ada5b5030fe73e601f1e8/src/librustc_mir/transform/const_prop.rs#L561">https://github.com/rust-lang/rust/blob/acb6690e1d58fc5f262ada5b5030fe73e601f1e8/src/librustc_mir/transform/const_prop.rs#L561</a> but for <code>rvalue</code></p>



<a name="184269585"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Specialization%20causes%20mis-optimizations/near/184269585" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Specialization.20causes.20mis-optimizations.html#184269585">(Dec 26 2019 at 16:28)</a>:</h4>
<p>I pushed an update</p>



<a name="184269587"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Specialization%20causes%20mis-optimizations/near/184269587" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Specialization.20causes.20mis-optimizations.html#184269587">(Dec 26 2019 at 16:28)</a>:</h4>
<p>you can try another rebase</p>



<a name="184269596"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Specialization%20causes%20mis-optimizations/near/184269596" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Specialization.20causes.20mis-optimizations.html#184269596">(Dec 26 2019 at 16:28)</a>:</h4>
<p>I wish <code>hub</code> had <code>hub pr rebase</code> and not just <code>hub pr checkout</code></p>



<a name="184273795"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Specialization%20causes%20mis-optimizations/near/184273795" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> anp <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Specialization.20causes.20mis-optimizations.html#184273795">(Dec 26 2019 at 17:51)</a>:</h4>
<p>thanks! i’m in the office now and don’t have my rustc work checked out on this machine, will try in a few hours when the temp on our floor drives me back home</p>



<a name="184278188"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Specialization%20causes%20mis-optimizations/near/184278188" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> anp <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Specialization.20causes.20mis-optimizations.html#184278188">(Dec 26 2019 at 19:14)</a>:</h4>
<p>that fixed it! woohoo :D</p>



<a name="184278529"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Specialization%20causes%20mis-optimizations/near/184278529" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Specialization.20causes.20mis-optimizations.html#184278529">(Dec 26 2019 at 19:24)</a>:</h4>
<p>awesome!</p>



<a name="184294066"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Specialization%20causes%20mis-optimizations/near/184294066" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> anp <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Specialization.20causes.20mis-optimizations.html#184294066">(Dec 27 2019 at 02:08)</a>:</h4>
<p>i think <a href="https://github.com/rust-lang/rust/pull/67631" target="_blank" title="https://github.com/rust-lang/rust/pull/67631">https://github.com/rust-lang/rust/pull/67631</a> may need to be r+'d again after the failed rollup?</p>



<a name="184298810"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Specialization%20causes%20mis-optimizations/near/184298810" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Specialization.20causes.20mis-optimizations.html#184298810">(Dec 27 2019 at 04:38)</a>:</h4>
<p>Rollups are manual so it should be ok :)</p>



<a name="184298817"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Specialization%20causes%20mis-optimizations/near/184298817" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> anp <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Specialization.20causes.20mis-optimizations.html#184298817">(Dec 27 2019 at 04:39)</a>:</h4>
<p>oh i must have missed it when i checked homu earlier, woops!</p>



<a name="184311839"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Specialization%20causes%20mis-optimizations/near/184311839" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Specialization.20causes.20mis-optimizations.html#184311839">(Dec 27 2019 at 09:47)</a>:</h4>
<p>I just talked with <span class="user-mention" data-user-id="119009">@eddyb</span> maybe we should continue trying to pursue the branch that I started in <a href="https://github.com/oli-obk/rust/pull/new/instance_resolve_specialization" target="_blank" title="https://github.com/oli-obk/rust/pull/new/instance_resolve_specialization">https://github.com/oli-obk/rust/pull/new/instance_resolve_specialization</a></p>



<a name="184335577"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Specialization%20causes%20mis-optimizations/near/184335577" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> anp <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Specialization.20causes.20mis-optimizations.html#184335577">(Dec 27 2019 at 18:16)</a>:</h4>
<p><span class="user-mention" data-user-id="125250">@Wesley Wiser</span> i'm around on&amp;off today if you want me to poke at stuff related to 67662</p>



<a name="184335607"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Specialization%20causes%20mis-optimizations/near/184335607" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Specialization.20causes.20mis-optimizations.html#184335607">(Dec 27 2019 at 18:17)</a>:</h4>
<p>I have an idea how we can have our <span aria-label="cake" class="emoji emoji-1f370" role="img" title="cake">:cake:</span> and eat it, too</p>



<a name="184335626"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Specialization%20causes%20mis-optimizations/near/184335626" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Specialization.20causes.20mis-optimizations.html#184335626">(Dec 27 2019 at 18:17)</a>:</h4>
<p>Wonderful!</p>



<a name="184335636"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Specialization%20causes%20mis-optimizations/near/184335636" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Specialization.20causes.20mis-optimizations.html#184335636">(Dec 27 2019 at 18:17)</a>:</h4>
<p>I'll make my PR turn the hard error into a lint, then you can <code>warn(const_err)</code> in the test</p>



<a name="184335686"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Specialization%20causes%20mis-optimizations/near/184335686" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Specialization.20causes.20mis-optimizations.html#184335686">(Dec 27 2019 at 18:18)</a>:</h4>
<p>it's hacky, but it allows us to make the hard error change later while giving ppl a heads up that this is problematic <em>now</em></p>



<a name="184335699"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Specialization%20causes%20mis-optimizations/near/184335699" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Specialization.20causes.20mis-optimizations.html#184335699">(Dec 27 2019 at 18:18)</a>:</h4>
<p>Doesn't it already fall into the <code>const_prop</code> error handling machinery?</p>



<a name="184335710"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Specialization%20causes%20mis-optimizations/near/184335710" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Specialization.20causes.20mis-optimizations.html#184335710">(Dec 27 2019 at 18:19)</a>:</h4>
<p>Or is because it's a cross crate macro that we have to do something special?</p>



<a name="184335741"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Specialization%20causes%20mis-optimizations/near/184335741" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Specialization.20causes.20mis-optimizations.html#184335741">(Dec 27 2019 at 18:20)</a>:</h4>
<p>no it's because using the constant will cause a hard error</p>



<a name="184335782"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Specialization%20causes%20mis-optimizations/near/184335782" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Specialization.20causes.20mis-optimizations.html#184335782">(Dec 27 2019 at 18:20)</a>:</h4>
<p><a href="https://github.com/rust-lang/rust/blob/41501a6b03a8f10d8c29dfcb37dbd5ff84b33f34/src/librustc_mir/transform/const_prop.rs#L418" target="_blank" title="https://github.com/rust-lang/rust/blob/41501a6b03a8f10d8c29dfcb37dbd5ff84b33f34/src/librustc_mir/transform/const_prop.rs#L418">https://github.com/rust-lang/rust/blob/41501a6b03a8f10d8c29dfcb37dbd5ff84b33f34/src/librustc_mir/transform/const_prop.rs#L418</a></p>



<a name="184336039"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Specialization%20causes%20mis-optimizations/near/184336039" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Specialization.20causes.20mis-optimizations.html#184336039">(Dec 27 2019 at 18:26)</a>:</h4>
<div class="codehilite"><pre><span></span>[santiago@galago myapp (master)]$ hyperfine --warmup 3 &#39;rustc src/main.rs&#39; &#39;~/src/oss/rust2/build/x86_64-unknown-linux-gnu/stage1/bin/rustc src/main.rs&#39;
Benchmark #1: rustc src/main.rs
  Time (mean ± σ):     12.090 s ±  1.243 s    [User: 11.974 s, System: 0.045 s]
  Range (min … max):    9.891 s … 14.533 s    10 runs

Benchmark #2: ~/src/oss/rust2/build/x86_64-unknown-linux-gnu/stage1/bin/rustc src/main.rs
  Time (mean ± σ):     14.321 s ±  1.798 s    [User: 14.200 s, System: 0.053 s]
  Range (min … max):   12.783 s … 17.701 s    10 runs

Summary
  &#39;rustc src/main.rs&#39; ran
    1.18 ± 0.19 times faster than &#39;~/src/oss/rust2/build/x86_64-unknown-linux-gnu/stage1/bin/rustc src/main.rs&#39;
</pre></div>



<a name="184336043"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Specialization%20causes%20mis-optimizations/near/184336043" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Specialization.20causes.20mis-optimizations.html#184336043">(Dec 27 2019 at 18:26)</a>:</h4>
<p><span class="user-mention" data-user-id="124288">@oli</span> this is on my example</p>



<a name="184336047"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Specialization%20causes%20mis-optimizations/near/184336047" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Specialization.20causes.20mis-optimizations.html#184336047">(Dec 27 2019 at 18:26)</a>:</h4>
<p>both patches</p>



<a name="184336050"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Specialization%20causes%20mis-optimizations/near/184336050" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Specialization.20causes.20mis-optimizations.html#184336050">(Dec 27 2019 at 18:26)</a>:</h4>
<p>I think that's way better</p>



<a name="184336054"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Specialization%20causes%20mis-optimizations/near/184336054" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Specialization.20causes.20mis-optimizations.html#184336054">(Dec 27 2019 at 18:26)</a>:</h4>
<p>definitely</p>



<a name="184336058"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Specialization%20causes%20mis-optimizations/near/184336058" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Specialization.20causes.20mis-optimizations.html#184336058">(Dec 27 2019 at 18:27)</a>:</h4>
<p>still 18% slower but at least not 50%</p>



<a name="184336064"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Specialization%20causes%20mis-optimizations/near/184336064" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Specialization.20causes.20mis-optimizations.html#184336064">(Dec 27 2019 at 18:27)</a>:</h4>
<p><span aria-label="joy" class="emoji emoji-1f602" role="img" title="joy">:joy:</span></p>



<a name="184336066"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Specialization%20causes%20mis-optimizations/near/184336066" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Specialization.20causes.20mis-optimizations.html#184336066">(Dec 27 2019 at 18:27)</a>:</h4>
<p>hehe</p>



<a name="184336075"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Specialization%20causes%20mis-optimizations/near/184336075" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Specialization.20causes.20mis-optimizations.html#184336075">(Dec 27 2019 at 18:27)</a>:</h4>
<p>I think we can work with this</p>



<a name="184347293"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Specialization%20causes%20mis-optimizations/near/184347293" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> anp <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Specialization.20causes.20mis-optimizations.html#184347293">(Dec 27 2019 at 22:30)</a>:</h4>
<p><span class="user-mention" data-user-id="125250">@Wesley Wiser</span> can you r+ 67631 again?</p>



<a name="184348522"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Specialization%20causes%20mis-optimizations/near/184348522" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Specialization.20causes.20mis-optimizations.html#184348522">(Dec 27 2019 at 22:59)</a>:</h4>
<p>no</p>



<a name="184348525"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Specialization%20causes%20mis-optimizations/near/184348525" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Specialization.20causes.20mis-optimizations.html#184348525">(Dec 27 2019 at 23:00)</a>:</h4>
<p>wait :D</p>



<a name="184348569"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Specialization%20causes%20mis-optimizations/near/184348569" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Specialization.20causes.20mis-optimizations.html#184348569">(Dec 27 2019 at 23:00)</a>:</h4>
<p>I'm fixing it up for the warning stuff</p>



<a name="184348584"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Specialization%20causes%20mis-optimizations/near/184348584" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Specialization.20causes.20mis-optimizations.html#184348584">(Dec 27 2019 at 23:00)</a>:</h4>
<p>sorry didn't get to that yet, but I have time now and should have something within the hour</p>



<a name="184348610"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Specialization%20causes%20mis-optimizations/near/184348610" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> anp <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Specialization.20causes.20mis-optimizations.html#184348610">(Dec 27 2019 at 23:01)</a>:</h4>
<p>oh cool!</p>



<a name="184352197"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Specialization%20causes%20mis-optimizations/near/184352197" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Specialization.20causes.20mis-optimizations.html#184352197">(Dec 28 2019 at 00:49)</a>:</h4>
<p>Tests are running, going to bed now</p>



<a name="184382918"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Specialization%20causes%20mis-optimizations/near/184382918" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> anp <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Specialization.20causes.20mis-optimizations.html#184382918">(Dec 28 2019 at 17:12)</a>:</h4>
<p>how'd they fare</p>



<a name="184383564"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Specialization%20causes%20mis-optimizations/near/184383564" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Specialization.20causes.20mis-optimizations.html#184383564">(Dec 28 2019 at 17:31)</a>:</h4>
<p>badly, fighting with the interner</p>



<a name="184383643"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Specialization%20causes%20mis-optimizations/near/184383643" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> anp <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Specialization.20causes.20mis-optimizations.html#184383643">(Dec 28 2019 at 17:33)</a>:</h4>
<p>and people talk about fighting borrowck</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>